const {
	json
} = require('express');
var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
	res.render('index', {
		title: 'Express'
	});
});

//主页选项信息
router.get('/api/index_list/data', function(req, res, next) {
	res.send({
		"code": 0,
		"data": {
			topBar: [{
					id: 1,
					name: 'A1AA'
				},
				{
					id: 2,
					name: 'B2BB'
				},
				{
					id: 3,
					name: 'C3CC'
				},
				{
					id: 4,
					name: 'D4DD'
				},
				{
					id: 5,
					name: 'E5EE'
				},
				{
					id: 6,
					name: 'F6FF'
				}
			],
			data: [{
					type: "swiperList",
					data: [{
							imgUrl: '../../static/img/1.webp'
						},
						{
							imgUrl: '../../static/img/2.webp'
						},
						{
							imgUrl: '../../static/img/3.webp'
						}
					]
				},
				{
					type: "recommendList",
					data: [{
						bigUrl: '../../static/img/1.webp',
						data: [{
								imgUrl: '../../static/img/2.webp'
							},
							{
								imgUrl: '../../static/img/3.webp'
							},
							{
								imgUrl: '../../static/img/4.webp'
							}
						]
					}]
				},
				{
					type: "commondityList",
					data: [{
							id: 1,
							imgUrl: "../../static/img/1.webp",
							name: "ssssssssssssssssssssssss",
							pprice: "229",
							oprice: "659",
							discount: "5.2"
						},
						{
							id: 2,
							imgUrl: "../../static/img/2.webp",
							name: "ssssssssssssssssssssssss",
							pprice: "229",
							oprice: "659",
							discount: "5.2"
						}
					]
				}
			]
		}
	})
});
//分页数据2
router.get('/api/index_list/2/data/1', function(req, res, next) {
	res.json({
		code: "0",
		data: [{
				type: "bannerList",
				imgUrl: "../../static/img/1.webp"
			},
			{
				type: "iconsList",
				data: [{
						imgUrl: "../../static/img/1.webp",
						name: "A2"
					},
					{
						imgUrl: "../../static/img/2.webp",
						name: "B2"
					},
					{
						imgUrl: "../../static/img/3.webp",
						name: "C2"
					},
					{
						imgUrl: "../../static/img/4.webp",
						name: "D2"
					},
					{
						imgUrl: "../../static/img/1.webp",
						name: "A2"
					},
					{
						imgUrl: "../../static/img/2.webp",
						name: "B2"
					},
					{
						imgUrl: "../../static/img/3.webp",
						name: "C2"
					},
					{
						imgUrl: "../../static/img/4.webp",
						name: "D2"
					}
				]
			},
			{
				type: "hotList",
				data: [{
						id: 1,
						imgUrl: "../../static/img/3.webp",
						name: "ssssssssssssssssssssssss",
						pprice: "229",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 2,
						imgUrl: "../../static/img/4.webp",
						name: "ssssssssssssssssssssssss",
						pprice: "229",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 3,
						imgUrl: "../../static/img/2.webp",
						name: "ssssssssssssssssssssssss",
						pprice: "229",
						oprice: "659",
						discount: "5.2"
					}
				]
			},
			{
				type: "shopList",
				data: [{
						bigUrl: "../../static/img/3.webp",
						data: [{
								id: 1,
								imgUrl: "../../static/img/3.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 2,
								imgUrl: "../../static/img/4.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 3,
								imgUrl: "../../static/img/2.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 4,
								imgUrl: "../../static/img/1.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							}
						]
					},
					{
						bigUrl: "../../static/img/3.webp",
						data: [{
								id: 1,
								imgUrl: "../../static/img/3.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 2,
								imgUrl: "../../static/img/4.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 3,
								imgUrl: "../../static/img/2.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 4,
								imgUrl: "../../static/img/1.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							}
						]
					}
				]
			},
			{
				type: "commondityList",
				data: [{
						id: 1,
						imgUrl: "../../static/img/1.webp",
						name: "ssssssssssssssssssssssss",
						pprice: "229",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 2,
						imgUrl: "../../static/img/2.webp",
						name: "ssssssssssssssssssssssss",
						pprice: "229",
						oprice: "659",
						discount: "5.2"
					}
				]
			}
		]
	})
});
//分页数据3
router.get('/api/index_list/3/data/1', function(req, res, next) {
	res.json({
		code: "0",
		data: [{
				type: "bannerList",
				imgUrl: "../../static/img/1.webp"
			},
			{
				type: "iconsList",
				data: [{
						imgUrl: "../../static/img/1.webp",
						name: "A3"
					},
					{
						imgUrl: "../../static/img/2.webp",
						name: "B3"
					},
					{
						imgUrl: "../../static/img/3.webp",
						name: "C3"
					},
					{
						imgUrl: "../../static/img/4.webp",
						name: "D3"
					},
					{
						imgUrl: "../../static/img/1.webp",
						name: "A3"
					},
					{
						imgUrl: "../../static/img/2.webp",
						name: "B3"
					},
					{
						imgUrl: "../../static/img/3.webp",
						name: "C3"
					},
					{
						imgUrl: "../../static/img/4.webp",
						name: "D3"
					}
				]
			},
			{
				type: "hotList",
				data: [{
						id: 1,
						imgUrl: "../../static/img/3.webp",
						name: "ssssssssssssssssssssssss",
						pprice: "229",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 2,
						imgUrl: "../../static/img/4.webp",
						name: "ssssssssssssssssssssssss",
						pprice: "229",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 3,
						imgUrl: "../../static/img/2.webp",
						name: "ssssssssssssssssssssssss",
						pprice: "229",
						oprice: "659",
						discount: "5.2"
					}
				]
			},
			{
				type: "shopList",
				data: [{
						bigUrl: "../../static/img/3.webp",
						data: [{
								id: 1,
								imgUrl: "../../static/img/3.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 2,
								imgUrl: "../../static/img/4.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 3,
								imgUrl: "../../static/img/2.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 4,
								imgUrl: "../../static/img/1.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							}
						]
					},
					{
						bigUrl: "../../static/img/3.webp",
						data: [{
								id: 1,
								imgUrl: "../../static/img/3.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 2,
								imgUrl: "../../static/img/4.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 3,
								imgUrl: "../../static/img/2.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							},
							{
								id: 4,
								imgUrl: "../../static/img/1.webp",
								name: "ssssssssssssssssssssssss",
								pprice: "229",
								oprice: "659",
								discount: "5.2"
							}
						]
					}
				]
			},
			{
				type: "commondityList",
				data: [{
						id: 1,
						imgUrl: "../../static/img/1.webp",
						name: "ssssssssssssssssssssssss",
						pprice: "229",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 2,
						imgUrl: "../../static/img/2.webp",
						name: "ssssssssssssssssssssssss",
						pprice: "229",
						oprice: "659",
						discount: "5.2"
					}
				]
			}
		]
	})
});

router.get('/api/index_list/2/data/2', function(req, res, next) {
	res.json({
		code:"0",
		data:[
		{
			type: "commondityList",
			data: [{
					id: 1,
					imgUrl: "../../static/img/1.webp",
					name: "ssssssssssssssssssssssss",
					pprice: "229",
					oprice: "659",
					discount: "5.2"
				},
				{
					id: 2,
					imgUrl: "../../static/img/2.webp",
					name: "ssssssssssssssssssssssss",
					pprice: "229",
					oprice: "659",
					discount: "5.2"
				}
			]
		}]
	})
});

router.get('/api/index_list/2/data/3', function(req, res, next) {
	res.json({
		code:"0",
		data:[
		{
			type: "commondityList",
			data: [{
					id: 1,
					imgUrl: "../../static/img/1.webp",
					name: "ssssssssssssssssssssssss",
					pprice: "229",
					oprice: "659",
					discount: "5.2"
				},
				{
					id: 2,
					imgUrl: "../../static/img/2.webp",
					name: "ssssssssssssssssssssssss",
					pprice: "229",
					oprice: "659",
					discount: "5.2"
				}
			]
		}]
	})
});

router.get('/api/index_list/2/data/2', function(req, res, next) {
	res.json({
		code:"0",
		data:[
		{
			type: "commondityList",
			data: [{
					id: 1,
					imgUrl: "../../static/img/1.webp",
					name: "ssssssssssssssssssssssss",
					pprice: "229",
					oprice: "659",
					discount: "5.2"
				},
				{
					id: 2,
					imgUrl: "../../static/img/2.webp",
					name: "ssssssssssssssssssssssss",
					pprice: "229",
					oprice: "659",
					discount: "5.2"
				}
			]
		}]
	})
});
router.get('/api/goods/list', function(req, res, next) {
	res.json({
		code:"0",
		data:[
			{
				id:1,
				name:"A",
				data:[
				{
					name:"A1",
					list:[
						{
							id:1,
							name:"A1A",
							imgUrl:"../../static/img/1.webp"
						},
						{
							id:2,
							name:"A1B",
							imgUrl:"../../static/img/1.webp"
						}
					]
				},
				{
					name:"A2",
					list:[
						{
							id:1,
							name:"A2A",
							imgUrl:"../../static/img/2.webp"
						},
						{
							id:2,
							name:"A2B",
							imgUrl:"../../static/img/2.webp"
						}
					]
				},
				{
					name:"A3",
					list:[
						{
							id:1,
							name:"A3A",
							imgUrl:"../../static/img/3.webp"
						},
						{
							id:2,
							name:"A3B",
							imgUrl:"../../static/img/3.webp"
						}
					]
				}
				]	
			},
			{
				id:2,
				name:"B",
				data:[
				{
					name:"B1",
					list:[
						{
							id:1,
							name:"B1A",
							imgUrl:"../../static/img/3.webp"
						},
						{
							id:2,
							name:"B1B",
							imgUrl:"../../static/img/1.webp"
						}
					]
				},
				{
					name:"B2",
					list:[
						{
							id:1,
							name:"B2A",
							imgUrl:"../../static/img/2.webp"
						},
						{
							id:2,
							name:"B2B",
							imgUrl:"../../static/img/4.webp"
						}
					]
				},
				{
					name:"B3",
					list:[
						{
							id:1,
							name:"B3A",
							imgUrl:"../../static/img/3.webp"
						},
						{
							id:2,
							name:"B3B",
							imgUrl:"../../static/img/1.webp"
						}
					]
				}
				]	
			}
		]
	})
});
module.exports = router;